<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" isELIgnored="false" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<!DOCTYPE html>
<html>
<head>
    <jsp:include page="/WEB-INF/jsp/include/head.jsp"/>
</head>
<body>

<ol class="breadcrumb">
    <li><strong>当前位置： </strong>标准化管理</li>
    <li class="active">投诉举报</li>
</ol>


<div id="toolbar">
    <button id="btn_add" type="button" style="margin-left: 5px" class="btn btn-default "><span
            class="glyphicon glyphicon-plus-sign"></span>&nbsp;&nbsp;添&nbsp;&nbsp;加&nbsp;</button>
</div>

<table id="table_data"></table>

<div class="modal fade" id="modal_ajax">
    <div class="modal-dialog  modal-mid ">
        <div class="modal-content ">
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div><!-- /.modal -->

<jsp:include page="/WEB-INF/jsp/include/footer.jsp"/>

<script>

    $("#btn_add").click(function () {
        $('#modal_ajax').modal({
            backdrop: 'static',
            keyboard: false,
            show: true,
            remote: 'expertInfo/illegalBehavior/editDlg'
        });
    });

    $("#table_data").bootstrapTable({
        url: 'expertInfo/illegalBehavior/select',
        striped: true,
        cache: false,
        sidePagination: 'client',
        searchOnEnterKey: false,
        showRefresh: true,
        search: true,
        toolbar: "#toolbar",
        toolbarAlign:'right',
        pageSize: 10,
        pageList: [10, 20, 50],
        pageNumber: 1,
        pagination: true,
        columns: [
            {

                formatter: function (value, row, index) {
                    return [
                        index + 1
                    ].join('');
                }
            },
            {
                field: 'expertBase',
                title: '姓名',
                formatter: function (value, row, index) {

                    return value.name;
                }
            }, {
                field: 'expertBase',
                title: '身份证号',
                formatter: function (value, row, index) {
                    return value.idCard;
                }
            },
            {
                field: 'itemId',
                title: '事项',
                formatter: function (value, row, index) {
                    var s = "";
                    $.each(itemTypeAll, function (i, v) {
                        if (v.id == value) {
                            s = v.name;
                        }
                    });
                    return s;
                }
            },
            {
                field: 'createTime',
                title: '检举时间',
                formatter: function (value, row, index) {
                    return $.Helper.dataTimeHelper.int2DateString(value);
                }
            }, {
                field: 'reason',
                width:250,
                title: '原因'
            }, {
                title: '操作',
                events: 'operateEvents',
                formatter: function (value, row, index) {
                    return [
                        '<button id="button" class="btn btn-default btn-xs   delete_data">',
                        '<span class="glyphicon glyphicon-remove" aria-hidden="true"></span>',
                        ' 删 除',
                        '</button>'
                    ].join('');
                }
            }
        ]
    });

    window.operateEvents = {
        'click .delete_data': function (e, value, row, index) {
            $.sysPlugin.superAjax({
                data: {id: row.id},
                url: 'expertInfo/illegalBehavior/delete',
                operateType: 'delete',
                showSuccessAlert: true,
                showWarnAlert: true,
                successCall: function (data) {
                    $.sysPlugin.successCallBack(data, {
                        table: $("#table_data")
                    })
                }
            })

        }
    };

    var itemTypeAll =${itemTypeAll};
    $.sysPlugin.clearModalRemoveData("modal_ajax");
</script>


</body>
</html>
